#include "widget.h"
#include "ui_widget.h"
#include <QFileDialog>
#include <QDebug>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    const QString &path = QFileDialog::getOpenFileName(this);

    //构建一个QFileINfo对象
    QFileInfo fileInfo(path);
    qDebug() << fileInfo.fileName();
    qDebug() << fileInfo.filePath();
    qDebug() << fileInfo.isFile();
    qDebug() << fileInfo.isDir();
}
